package org.example.maven.controller;

import org.example.maven.pojo.Result;
import org.example.maven.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("/permission")
public class PermissionController {
    @Autowired
    private PermissionService permissionService;
    @GetMapping
    @PreAuthorize("permitAll()")
    //获取权限多选框的选项信息
    public Result getPermissionSelect(){
        return Result.success(permissionService.getPermissionSelect());
    }

}
